<template>
    <!-- 底部评论区 start -->
    <footer class="footer-box">
        <div class="comment-input" v-show="!showComments" @click="showComments=true">不想说点什么吗？</div>
        <!-- <div class="comment-detail" v-show="showComments" @click.self="showComments=false"> -->
        <div class="comment-detail" v-show="showComments" @click="showComments=false">
            <div class="user-input" @click.stop>
                <h4>头像</h4>
                <ul class="user-head" @click.capture.stop="chooseUserImg($event.target)">
                    <li v-for="(value,index) in 24" :key="index" :user-img="`user${value}.png`" :class="`user${value}.png`==userComments.userImage?'user-choose':''" :style="`background-image:url(../imgs/users/user${value}.png);`"></li>
                </ul>
                <h4>昵称</h4>
                <input class="user-nikename" type="text" placeholder="昵称">
                <h4>评分</h4>
                <div class="film-source reset-star">
                    <span class="star-img open"></span>
                    <span class="star-img open"></span>
                    <span class="star-img open"></span>
                    <span class="star-img close"></span>
                    <span class="star-img close"></span>
                    <span class="star-source">7.9</span>
                </div>
                <h4>评论</h4>
                <textarea class="user-message" placeholder="留下点足迹..."></textarea>
                <div class="send-btn">
                    <span @click="showComments=false">关闭</span>
                    <span>发送</span>
                </div>
            </div>
        </div>
    </footer>
    <!-- 底部评论区 end -->
</template>
<script>
export default {
    data() {
        return {
            showComments: false,
            userComments: {
                userImage: "user1.png"
            }
        };
    },
    methods: {
        chooseUserImg(e) {
            // console.log(e);
            // console.log(e.getAttribute("user-img"));
            this.userComments.userImage = e.getAttribute("user-img");
        }
    }
};
</script>
<style lang="less" scoped>
@import "../less/footer.less";
// 评论组件
.film-comments {
    color: @gray-dark;
    padding-bottom: 0.3rem;
    font-size: 0rem;
    > .comment-title {
        font-size: 0.36rem;
        color: @gray;
        padding: 0rem 0.2rem;
        margin-bottom: 0.2rem;
    }
    > .comment-list {
        width: 100%;
        padding-bottom: 0.1rem;
    }
}
.comment-item {
    display: grid;
    grid-template-columns: 1fr 6fr;
    grid-template-rows: auto auto;
    padding: 0rem 0.2rem 0.6rem 0.2rem;
    > .user-img {
        width: 100%;
        > img {
            width: 100%;
            height: auto;
            border-radius: 50%;
        }
    }
    > .user-info {
        font-size: 0.3rem;
        padding-left: 0.2rem;
        > .user-name {
            margin-top: 0.1rem;
            > .film-source {
                float: right;
            }
        }
        > .user-time {
            margin-top: 0.1rem;
            font-size: 0.26rem;
            color: @gray;
        }
    }
    > .user-conent {
        font-size: 0.24rem;
        text-indent: 0.56rem;
        line-height: 0.4rem;
        grid-column-start: 2;
        grid-column-end: 3;
        padding-left: 0.2rem;
    }
}
</style>